/*
 * AgentConfiguration.cpp
 *
 *  Created on: Jan 26, 2009
 *      Author: Andrzej Olchawa
 *      mailto: andrzejolchawa@gmail.com
 *      http://www.hardtechnology.org
 *      This is a part of the Armazd project, which is covered by
 *      GNU GPL v2 license.
 */

#include "AgentConfiguration.h"

string AgentConfiguration::destinationsConfigPaht = "";
string AgentConfiguration::sensorsConfigPath = "";
string AgentConfiguration::listenersConfigPath = "";

AgentConfiguration::AgentConfiguration() {}

AgentConfiguration::~AgentConfiguration() {}

string AgentConfiguration::getDestinationsConfigPaht()
{
	return destinationsConfigPaht;
}

string AgentConfiguration::getSensorsConfigPath()
{
	return sensorsConfigPath;
}

string AgentConfiguration::getListenersConfigPath()
{
	return listenersConfigPath;
}

void AgentConfiguration::loadConfiguration()
{
	HTProperties properties;
	try
	{
		properties.loadProperties(CONFIG_FILE_PATH);

		destinationsConfigPaht = HTStringUtilities::trim(properties[DESTINATIONS_CONFIG_PATH],"\"");
		sensorsConfigPath      = HTStringUtilities::trim(properties[SENSORS_CONFIG_PATH],"\"");
		listenersConfigPath    = HTStringUtilities::trim(properties[LISTENERS_CONFIG_PATH],"\"");
	}
	catch (HTException &e)
	{
		e.printException();
	}
}
